<?php

require_once("ui.php");
require_once("report.template.php");

class OptionalTab {
		
	private function printRevisionLineEdit() {
		
		$previousValue = getOriginalPost(INPUT_REVISION_ID);
		$previousValue = ($previousValue == null) ? "" : $previousValue;
		 
		echo '<input type="text" value="' . $previousValue . '" name="' .
			INPUT_REVISION_ID . '" class="inlineTextInput"/>';
	} 

	private function printCommentArea() {
		
		$previousValue = getOriginalPost(INPUT_COMMENT_TEXT_AREA);
		$previousValue = ($previousValue == null) ? "" : $previousValue;
		
		echo '<textarea id="' . INPUT_COMMENT_TEXT_AREA . '"
			name="' . INPUT_COMMENT_TEXT_AREA . '">' . $previousValue . '</textarea>';
	}
	
	public function printTabContent() {
?>
				<div class="reportTab" id="optionalTab">
					<table>
						<tbody>
							<tr>
								<td>Revision identifier</td>
								<td>
									<?php $this->printRevisionLineEdit(); ?>
									<div class="help" onmouseover="popup('Commiting the bugfix and posting the revision identifier significantly helps to review this record in unclear cases.');"></div>
								</td>
							</tr>
							<tr>
								<td>Comments</td>
								<td>
									You can optionally describe additional details about the bug or the debugging process. This often specifies what has happened in much more precise way.<br>
									<?php $this->printCommentArea(); ?>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
<?php 	
	}
}
?>